#pragma once
#define MAX_ELEMENT_COUNT 50

struct mapElement_t
{
	char keyname[50];
	int  keyvalue;

	char valueString[100];
	int  valueInt;
	double valueDouble;
	void* valueObject;
};

class CFxMap
{
public:
	CFxMap(void);
	~CFxMap(void);

public:
	BOOL SetString(char* keyname, char* value);
	char* GetString(char* keyname);
	BOOL SetInt(char* keyname, int value);
	int GetInt(char* keyname);
	BOOL SetDouble(char* keyname, double value);
	double GetDouble(char* keyname);
	BOOL SetObject(char* keyname, void* object);
	void* GetObject(char* keyname);

	BOOL SetString(int keyvalue, char* value);
	char* GetString(int keyvalue);
	BOOL SetInt(int keyvalue, int value);
	int GetInt(int keyvalue);
	BOOL SetDouble(int keyvalue, double value);
	double GetDouble(int keyvalue);
	BOOL SetObject(int keyvalue, void* object);
	void* GetObject(int keyvalue);
	void Clear();

private:
	int lookup(char* keyname); // index of key
	int lookup(int keyvalue); // index of key

	mapElement_t map[MAX_ELEMENT_COUNT];
	int elementCount;
};
